#include "Food.h"
#include <stdlib.h>
extern int width;
extern int height;

Food::Food(Snake& snake)
:_snake(snake){
	setFood();
}


void Food::setFood() {
	_pos._x = rand() % (width-2) + 1;
	_pos._y = rand() % (height-2) + 1;
}
Pos Food::getPos() {
	return _pos;
}

bool Food::isFood(const Pos& pos)
{
	return this->_pos == pos?true:false;
}
